package com.sharp.kernel.mybatis.mapper.batch;

import com.sharp.kernel.mybatis.provider.BatchInsertProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import tk.mybatis.mapper.annotation.RegisterMapper;
import tk.mybatis.mapper.common.special.InsertListMapper;

import java.util.List;

/**
 * Title: MySqlBatchInsertMapper
 * Description: Copyright: Copyright (c) 2019 Company: BHFAE
 *
 * @author Sharp
 * @date 2022/6/29 17:16
 */
@RegisterMapper
public interface MySqlBatchInsertMapper<T> extends InsertListMapper<T> {
    @Options(
            useGeneratedKeys = true
    )
    @InsertProvider(
            type = BatchInsertProvider.class,
            method = "dynamicSQL"
    )
    int insertListWithPrimaryKey(List<? extends T> var1);
}
